# -*- coding: utf-8 -*-

import urllib2
import lxml import etree


url = 'https://www.dianping.com/shanghai/food'
data = urllib2.urlopen(url).read()

rule = 'href="(//www.dianping.com/.*?/food)"'

allcity = re.findall(rule, data)
allcity = set(allcity)



for city in allcity:
    data = urllib2.urlopen('https:' + city).read()
    all_region = []
    all_surver = []

